﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using FluentNHibernate.Mapping;
using MI.Entity;

namespace MI.ORM.Mapping
{
    public class CategoryMap : ClassMap<Category>
    {
        public CategoryMap()
        {
            Id(m => m.ID);
            Table("Categories");
            Map(m => m.Name);
            HasMany<Post>(m => m.Posts).KeyColumn("CategoryID").LazyLoad().Cascade.All();
        }
    }
}
